package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.CustomerReturnList;
import com.atguigu.jxc.service.SaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: dongdong lau
 * @CreateTime: 2021/7/25 15:18
 * @Description: 客户退货
 */
@RestController
@RequestMapping(value = "/customerReturnListGoods")
public class CustomerReturnController {

    @Autowired
    private SaleService saleService;

    /**
     * 客户退货单保存
     * @param returnNumber
     * @param customerReturnList
     * @param customerReturnListGoodsStr
     * @return
     */
    @RequestMapping("/save")
    public ServiceVO saveCustomerReturnList(@RequestParam String returnNumber,
                                            CustomerReturnList customerReturnList,
                                            String customerReturnListGoodsStr){
        // 为customerReturnList设置returnNumber
        customerReturnList.setReturnNumber(returnNumber);
        // 调用客户退货单保存接口
        ServiceVO serviceVO = saleService.customerReturnSave(customerReturnList, customerReturnListGoodsStr);
        // 返回结果
        return serviceVO;
    }
}
